<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-wms__container}">
      <wms-form 
        v-model="dataForm"
        :formList="formList"
        :table-column="tableColumn"
        :advanced="advanced"
        @check-change="checkChange"
        @changeAdvance="changeAdvance"
        @getDataList="getDataList"
        @getReset="getReset"
      >
      <el-form-item>
       <el-button v-if="$hasPermission('wms:container:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add')}}</el-button>
      </el-form-item>
      </wms-form>
      <wms-table
        ref="wmsTable"
        v-model="dataForm"
        :page="page"
        :total="total"
        :limit="limit"
        :tableData="dataList"
        :table-column="column"
        :module-options="mixinViewModuleOptions"
        :dataListLoading="dataListLoading"
        :showSelection="true"
        @addOrUpdateHandle="addOrUpdateHandle"
        @dataListSelectionChangeHandle="dataListSelectionChangeHandle"
        @deleteHandle="deleteHandle"
        @pageSizeChangeHandle="pageSizeChangeHandle"
        @pageCurrentChangeHandle="pageCurrentChangeHandle"/>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./components/container-add-or-update";
import debounce from "lodash/debounce";
import { formList, tableColumn } from './config'
import wmsTable from '@/components/wms-table'
import wmsForm from '@/components/wms-form'
export default {
  mixins: [mixinViewModule],
  data() {
    return {
      mixinViewModuleOptions: {
        getDataListURL: "/wms/container/page",
        getDataListIsPage: true,
        exportURL: "/wms/container/export",
        deleteURL: "/wms/container",
        deleteIsBatch: true,
        deleteIsBatchKey:'contId'
      },
      dataForm: {
        contId:'',
        contNo: '',
        contType: ''
      },
      formList,
      tableColumn,
      column: [],
      advanced: false
    };
  },
  components: {
    AddOrUpdate,
    wmsTable,
    wmsForm
  },
  methods: {
    //0.重置搜索框
    getReset() {
      this.dataForm = this.$options.data().dataForm;
    }
  },
};
</script>
<style>
.right-handle-group {
  float: right;
}
</style>


